<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>proCONTROLL : : ControllStick : : setMultiplier ( )</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="stylesheet.css" rel="stylesheet" type="text/css">
</head>
<body> 
<div id="page"> 
  <div id="describtion"> 
    <div id="libname"><img src="images/procontroll.gif" width="259" height="40"></div> 
    <div id="indexlink"><a href="index.htm"><img src="images/index.gif"></a></div> 
  </div> 
  <div id="point"> 
    <div id="pointname"> name </div> 
    <div id="pointcontent"><div id="membertitle"> setMultiplier ( ) </div></div> 
  </div> 
  <div id="point"> 
    <div id="pointname"><a href="#" id="exampleButton" onClick="handleExample()">openExample</a></div> 
    <div id="pointcontent"><div id="example"><pre>import procontroll.*;
import java.io.*;

ControllIO controll;
ControllDevice device;
ControllStick stick;
ControllButton button;

void setup(){
  size(400,400);
  
  controll = ControllIO.getInstance(this);

  device = controll.getDevice("Logitech RumblePad 2 USB");
  device.printSticks();
  
  stick = device.getStick("Z-Achse Z-Rotation");
  stick.setTolerance(0.05f);
  
  println("tolerance: " + stick.getTolerance());
  
  button = device.getButton("Taste 0");
  
  fill(0);
  rectMode(CENTER);
}

float totalX = width/2;
float totalY = height/2;
float multiplier = 1;

void draw(){
  background(255);
  
  if(button.pressed()){
    fill(255,0,0);
    multiplier += 0.05;
  }else{
    fill(0);
    multiplier -= 0.1;
    multiplier = max(1,multiplier);
  }
  
  stick.setMultiplier(multiplier);
  
  println("multiplier: " + stick.getMultiplier());
  
  totalX = constrain(totalX + stick.getX(),10,width-10);
  totalY = constrain(totalY + stick.getY(),10,height-10);
  
  rect(totalX,totalY,20,20);
}
</pre></div></div> 
  </div> 
  <div id="point"> 
    <div id="pointname"> description </div> 
    <div id="pointcontent">The value of a stick is a relative value between
 -1.0f und 1.0f with the multiplier you can increase 
 and decrese this range. Use this method to set the
 actual multiplier. By default this value is 1.0.</div> 
  </div> 
  <div id="point"> 
    <div id="pointname"> syntax </div> 
    <div id="pointcontent"> 
      <pre>setMultiplier(i_multiplier);
</pre> 
    </div> 
  </div> 
    
<div id="point"> 
  <div id="pointname"> returns </div> 
  <div id="pointcontent">None</div> 
</div> 

  <div id="point"> 
    <div id="pointname"> usage </div> 
    <div id="pointcontent">application</div> 
  </div> 
  <div id="point"> 
    <div id="pointname"> related </div> 
    <div id="pointcontent"><A href="controllstick_class_controllstick.htm">ControllStick</A><BR>
<A href="controllstick_method_getmultiplier.htm">getMultiplier ( )</A><BR>
</div> 
  </div> 
</div> 
</body>
<script language="JavaScript" src="script.js" type="text/javascript"></script>
</html>
